package com.feeyo.groundservice.composewidget.usage

import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import com.feeyo.groundservice.composewidget.usage.base.BaseComposeActivity
import com.feeyo.groundservice.composewidget.view.image_viewer.ImageViewer

/**
 *作者：QLH on 2023-08-13
 *描述：
 */
class ImageViewerActivity : BaseComposeActivity() {

   private val imageUrl =
        "https://pic.rmb.bdstatic.com/bjh/news/0d872e1d5685958e1c98fe5575eca368.gif"

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            ImagePreview()
        }
    }

    @Composable
    private fun ImagePreview() {
        Box {
            ImageViewer(
                model = imageUrl,
                modifier = Modifier.fillMaxSize().background(Color.Black),
                userCanRotation = true
            )
        }
    }
}